/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * insumos_articulos_catalogo.java
 *
 * Created on 30/05/2011, 04:50:46 PM
 */

package sie_invdis;



import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.text.ParseException;
import java.text.*;
/**
 *
 * @author Michelle
 */
public class insumos_articulos_catalogo extends javax.swing.JFrame {
private javax.swing.table.DefaultTableModel jtable_modelo;
private javax.swing.table.DefaultTableModel jtable_modelo_insumosstock;

      private int buscamp=1,controlcomboinsu=0,opbuscamp=1,control_enter=0,yacarguestock=0,indexactual=0;
      
      
      private bd_conexion x = new bd_conexion() ;
       //se creaa la variable resultset
      private ResultSet rs = null;
       private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
       //llamo almetodo para establecer la conexion
    /** Creates new form insumos_articulos_catalogo */
    public insumos_articulos_catalogo() {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_insumosstock();
        initComponents();
         this.setLocation(25,25);
         this.loadcomalmacenes();
        this.carga_datos_catalogo(0, 0, "",variables_global.getalmacen());

    this.buttonGroup1.setSelected(jrb_bclave.getModel(), true);
    this.buttonGroup2.setSelected(jrb_obexacto.getModel(), true);
    this.jtf_busqueda.requestFocus();

    jt_insumos_catalogo.getColumnModel().getColumn(0).setPreferredWidth(30);//status
    jt_insumos_catalogo.getColumnModel().getColumn(1).setPreferredWidth(60);//tipo elemento
    jt_insumos_catalogo.getColumnModel().getColumn(2).setPreferredWidth(70);//clave
    jt_insumos_catalogo.getColumnModel().getColumn(3).setPreferredWidth(120);//descripcion
    jt_insumos_catalogo.getColumnModel().getColumn(4).setPreferredWidth(95);//item
    jt_insumos_catalogo.getColumnModel().getColumn(5).setPreferredWidth(25);//precio
    jt_insumos_catalogo.getColumnModel().getColumn(6).setPreferredWidth(25);//precio
    jt_insumos_catalogo.getColumnModel().getColumn(7).setPreferredWidth(40);//F.Ult. compra
    jt_insumos_catalogo.getColumnModel().getColumn(8).setPreferredWidth(40);//F.Ult. compra
    jt_insumos_catalogo.getColumnModel().getColumn(9).setPreferredWidth(15);//prov
    jt_insumos_catalogo.getColumnModel().getColumn(10).setPreferredWidth(40);//observaciones
    jt_insumos_catalogo.getColumnModel().getColumn(11).setPreferredWidth(40);//Existencia
    jt_insumos_catalogo.getColumnModel().getColumn(12).setPreferredWidth(30);//Existencia
    jt_insumos_catalogo.getTableHeader().setBackground(Color.yellow);
    jt_insumos_catalogo.requestFocus();

     jt_insumos_catalogostock.getColumnModel().getColumn(0).setPreferredWidth(30);//status
    jt_insumos_catalogostock.getColumnModel().getColumn(1).setPreferredWidth(60);//tipo elemento
    jt_insumos_catalogostock.getColumnModel().getColumn(2).setPreferredWidth(70);//clave
    jt_insumos_catalogostock.getColumnModel().getColumn(3).setPreferredWidth(120);//descripcion
    jt_insumos_catalogostock.getColumnModel().getColumn(4).setPreferredWidth(95);//item
    jt_insumos_catalogostock.getColumnModel().getColumn(5).setPreferredWidth(25);//precio
    jt_insumos_catalogostock.getColumnModel().getColumn(6).setPreferredWidth(25);//precio
    jt_insumos_catalogostock.getColumnModel().getColumn(7).setPreferredWidth(55);//F.Ult. compra
    jt_insumos_catalogostock.getColumnModel().getColumn(8).setPreferredWidth(15);//prov
    jt_insumos_catalogostock.getColumnModel().getColumn(9).setPreferredWidth(60);//observaciones
    jt_insumos_catalogostock.getColumnModel().getColumn(10).setPreferredWidth(20);//Existencia
    jt_insumos_catalogostock.getColumnModel().getColumn(11).setPreferredWidth(60);//Existencia
    jt_insumos_catalogostock.getTableHeader().setBackground(Color.yellow);

    this.loadcombotipoinsu();
    controlcomboinsu=1;
    
    }


    private void iniciar_modelo_de_tabla()
    {
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Status</b></html>");
        jtable_modelo.addColumn("<html><b>Tipo Elemento</b></html>");
        jtable_modelo.addColumn("<html><b>Clave</b></html>");
        jtable_modelo.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo.addColumn("<html><b>Item.</b></html>");
        jtable_modelo.addColumn("<html><b>Un</b></html>");
        jtable_modelo.addColumn("<html><b>Costo</b></html>");
        jtable_modelo.addColumn("<html><b>Precio</b></html>");
        jtable_modelo.addColumn("<html><b>F. Ult. Compra</b></html>");
        jtable_modelo.addColumn("<html><b>Stock Min</b></html>");
        jtable_modelo.addColumn("<html><b>Observ.</b></html>");
        jtable_modelo.addColumn("<html><b>Exis.</b></html>");
        jtable_modelo.addColumn("<html><b>Exis. Un. E</b></html>");
        jtable_modelo.addColumn("<html><b>Alm.</b></html>");

    }
     private void iniciar_modelo_insumosstock()
    {
        jtable_modelo_insumosstock=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_insumosstock.addColumn("<html><b>Status</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Tipo Elemento</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Item.</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Un</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>F. Ult. Compra</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Stock Min</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Observaciones</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Exis.</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Exis. Un. E</b></html>");
        jtable_modelo_insumosstock.addColumn("<html><b>Almacen</b></html>");

    }

private void carga_datos_catalogo(int opcion, int opbuscamp,String busqueda,int almacen)
 {
        String textohtml="";
      textohtml="<tr><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th></tr>";
      int fila=0;
       while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
       DecimalFormat miformat = new DecimalFormat("###,###,###,###.##");
       DecimalFormat miformat2 = new DecimalFormat("###,###,###,###.###");
       Object[] fnewRow = new Object[14];
       String texto="select * from x1distribucion_insumos_articulos_catalogo("+opcion+","+opbuscamp+",'"+busqueda.toUpperCase().trim()+"',"+almacen+") as (id character varying(16),cod character varying(16), idstatus smallint, descristatus character varying(40), describinsumo character varying(80), itemprovee character varying(16), unisal character varying(3), unient character varying(3), facentunidad numeric, uniempaque character varying(12), tipoelemento smallint, describetipoelemen character varying(40), idfamilia character varying(5),describefamilia character varying(40),idlineainsu character varying(5), describelineainsu character varying(40), controlalmacen character varying(20), stockminimo numeric, stockmaximo numeric,precio1 numeric, precio2 numeric,ultimocosto numeric, costoprome numeric, fechaulticompra date, fechaultimaventa date, idprovee character varying(16), describeprovee character varying(80), impuesto1 numeric, impuesto2 numeric, usuario character varying(20),valor_x_insumo character varying(20), observacion character varying(255),existenciainsu numeric)";
       rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
       System.out.println(texto);
       try
        {
            while (rs.next())
                {
                    fnewRow[0]=rs.getString("descristatus");
                    fnewRow[1]=rs.getString("describetipoelemen");
                    fnewRow[2]=rs.getString("id");
                    fnewRow[3]=rs.getString("describinsumo");
                    fnewRow[4]=rs.getString("itemprovee");
                    fnewRow[5]=rs.getString("unisal");
                    fnewRow[6]=miformat2.format(rs.getFloat("ultimocosto"));
                    fnewRow[7]=miformat2.format(rs.getFloat("precio1"));
                    if (rs.getString("fechaulticompra")!= null)
                        {
                            fnewRow[8]=this.fechaeuropea(rs.getString("fechaulticompra"));
                         }
                     else
                         {
                            fnewRow[8]="";
                         }
                    fnewRow[9]=miformat.format(rs.getFloat("stockminimo"));
                    fnewRow[10]=rs.getString("observacion");
                    fnewRow[11]=miformat.format(rs.getFloat("existenciainsu"));
                    fnewRow[12]=miformat.format(rs.getFloat("existenciainsu")/rs.getFloat("facentunidad"))+" "+rs.getString("unient");
                    fnewRow[13]=this.jcmbx_almacenes.getSelectedItem().toString();
                    jtable_modelo.addRow(fnewRow);
                     if (fila<=0)
    					{
            					textohtml+= "<tr>";
        				}
					fila++;
                    textohtml+="<th>"+rs.getString ("id")+"<br>"+rs.getString ("describinsumo") + " Exis="+rs.getString ("existenciainsu")+ "<br>"+"<img src=\"http://"+variables_global.getHost()+"/javaweb/insumos/"+rs.getString ("id")+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                    if (fila>=4)
                        {
                            textohtml+= "</tr>";
                            fila=0;
                        }
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

    this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
    this.jlbl_textobuscado.setText(this.jtf_busqueda.getText().toUpperCase().trim());
     this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
 }

private void carga_datos_catalogo_stock(int opcion, int opbuscamp,String busqueda,int almacen)
 {
 String textohtml="";
      textohtml="<tr><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th></tr>";
      int fila=0;

       while(jtable_modelo_insumosstock.getRowCount()>0)jtable_modelo_insumosstock.removeRow(0);
       DecimalFormat miformat = new DecimalFormat("###,###,###,###.##");
       Object[] fnewRow = new Object[13];
       String texto="select * from x1distribucion_insumos_articulos_catalogo("+opcion+","+opbuscamp+",'"+busqueda.toUpperCase().trim()+"',"+almacen+") as (id character varying(16),cod character varying(16), idstatus smallint, descristatus character varying(40), describinsumo character varying(80), itemprovee character varying(16), unisal character varying(3), unient character varying(3), facentunidad numeric, uniempaque character varying(12), tipoelemento smallint, describetipoelemen character varying(40), idfamilia character varying(5),describefamilia character varying(40),idlineainsu character varying(5), describelineainsu character varying(40), controlalmacen character varying(20), stockminimo numeric, stockmaximo numeric,precio1 numeric, precio2 numeric,ultimocosto numeric, costoprome numeric, fechaulticompra date, fechaultimaventa date, idprovee character varying(16), describeprovee character varying(80), impuesto1 numeric, impuesto2 numeric, usuario character varying(20),valor_x_insumo character varying(20), observacion character varying(255),existenciainsu numeric)";
       rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
       System.out.println(texto);
       try
        {
            while (rs.next())
                {
                    fnewRow[0]=rs.getString("descristatus");
                    fnewRow[1]=rs.getString("describetipoelemen");
                    fnewRow[2]=rs.getString("id");
                    fnewRow[3]=rs.getString("describinsumo");
                    fnewRow[4]=rs.getString("itemprovee");
                    fnewRow[5]=rs.getString("unisal");
                    fnewRow[6]=rs.getString("precio1");
                    if (rs.getString("fechaulticompra")!= null)
                        {
                            fnewRow[7]=this.fechaeuropea(rs.getString("fechaulticompra"));
                         }
                     else
                         {
                            fnewRow[7]="";
                         }
                    fnewRow[8]=miformat.format(rs.getFloat("stockminimo"));
                    fnewRow[9]=rs.getString("observacion");
                    fnewRow[10]=rs.getString("existenciainsu");
                    fnewRow[11]=miformat.format(rs.getFloat("existenciainsu")/rs.getFloat("facentunidad"))+" "+rs.getString("unient");
                    fnewRow[12]="0:General";
                    jtable_modelo_insumosstock.addRow(fnewRow);
                     if (fila<=0)
    					{
            					textohtml+= "<tr>";
        				}
					fila++;
                    textohtml+="<th>"+rs.getString ("id")+"<br>"+rs.getString ("describinsumo") + " Exis="+rs.getString ("existenciainsu")+ "<br>"+"<img src=\"http://"+variables_global.getHost()+"/javaweb/insumos/"+rs.getString ("id")+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                    if (fila>=4)
                        {
                            textohtml+= "</tr>";
                            fila=0;
                        }
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

 }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jbtn_salir = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jrb_bclave = new javax.swing.JRadioButton();
        jrb_bdescrip = new javax.swing.JRadioButton();
        jtf_busqueda = new javax.swing.JTextField();
        jbtn_buscar = new javax.swing.JButton();
        jrb_bitem = new javax.swing.JRadioButton();
        jrb_bprecio = new javax.swing.JRadioButton();
        jrb_obexacto = new javax.swing.JRadioButton();
        jrb_obcomienza = new javax.swing.JRadioButton();
        jrb_obaniway = new javax.swing.JRadioButton();
        jrb_bidfam = new javax.swing.JRadioButton();
        jcbx_tipoinsumo = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jrbtn_tipoinsumo = new javax.swing.JRadioButton();
        jLabel7 = new javax.swing.JLabel();
        jcmbx_almacenes = new javax.swing.JComboBox();
        jRadioButton1 = new javax.swing.JRadioButton();
        jLabel1 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_insumos_catalogo = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jLabel4 = new javax.swing.JLabel();
        jlbl_textobuscado = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jlbl_cantidadregistros = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jt_insumos_catalogostock = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel5 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jepn_fotos = new javax.swing.JEditorPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(insumos_articulos_catalogo.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setName("jPanel1"); // NOI18N

        jbtn_salir.setIcon(resourceMap.getIcon("jbtn_salir.icon")); // NOI18N
        jbtn_salir.setText(resourceMap.getString("jbtn_salir.text")); // NOI18N
        jbtn_salir.setName("jbtn_salir"); // NOI18N
        jbtn_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_salirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(766, Short.MAX_VALUE)
                .addComponent(jbtn_salir))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jbtn_salir)
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        buttonGroup1.add(jrb_bclave);
        jrb_bclave.setText(resourceMap.getString("jrb_bclave.text")); // NOI18N
        jrb_bclave.setToolTipText(resourceMap.getString("jrb_bclave.toolTipText")); // NOI18N
        jrb_bclave.setActionCommand(resourceMap.getString("jrb_bclave.actionCommand")); // NOI18N
        jrb_bclave.setName("jrb_bclave"); // NOI18N
        jrb_bclave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bclaveActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bdescrip);
        jrb_bdescrip.setText(resourceMap.getString("jrb_bdescrip.text")); // NOI18N
        jrb_bdescrip.setToolTipText(resourceMap.getString("jrb_bdescrip.toolTipText")); // NOI18N
        jrb_bdescrip.setActionCommand(resourceMap.getString("jrb_bdescrip.actionCommand")); // NOI18N
        jrb_bdescrip.setName("jrb_bdescrip"); // NOI18N
        jrb_bdescrip.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bdescripActionPerformed(evt);
            }
        });

        jtf_busqueda.setToolTipText(resourceMap.getString("jtf_busqueda.toolTipText")); // NOI18N
        jtf_busqueda.setName("jtf_busqueda"); // NOI18N
        jtf_busqueda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_busquedaActionPerformed(evt);
            }
        });

        jbtn_buscar.setIcon(resourceMap.getIcon("jbtn_buscar.icon")); // NOI18N
        jbtn_buscar.setText(resourceMap.getString("jbtn_buscar.text")); // NOI18N
        jbtn_buscar.setName("jbtn_buscar"); // NOI18N
        jbtn_buscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_buscarActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bitem);
        jrb_bitem.setText(resourceMap.getString("jrb_bitem.text")); // NOI18N
        jrb_bitem.setToolTipText(resourceMap.getString("jrb_bitem.toolTipText")); // NOI18N
        jrb_bitem.setActionCommand(resourceMap.getString("jrb_bitem.actionCommand")); // NOI18N
        jrb_bitem.setName("jrb_bitem"); // NOI18N
        jrb_bitem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bitemActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bprecio);
        jrb_bprecio.setText(resourceMap.getString("jrb_bprecio.text")); // NOI18N
        jrb_bprecio.setToolTipText(resourceMap.getString("jrb_bprecio.toolTipText")); // NOI18N
        jrb_bprecio.setActionCommand(resourceMap.getString("jrb_bprecio.actionCommand")); // NOI18N
        jrb_bprecio.setName("jrb_bprecio"); // NOI18N
        jrb_bprecio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bprecioActionPerformed(evt);
            }
        });

        buttonGroup2.add(jrb_obexacto);
        jrb_obexacto.setText(resourceMap.getString("jrb_obexacto.text")); // NOI18N
        jrb_obexacto.setToolTipText(resourceMap.getString("jrb_obexacto.toolTipText")); // NOI18N
        jrb_obexacto.setActionCommand(resourceMap.getString("jrb_obexacto.actionCommand")); // NOI18N
        jrb_obexacto.setName("jrb_obexacto"); // NOI18N
        jrb_obexacto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_obexactoActionPerformed(evt);
            }
        });

        buttonGroup2.add(jrb_obcomienza);
        jrb_obcomienza.setText(resourceMap.getString("jrb_obcomienza.text")); // NOI18N
        jrb_obcomienza.setToolTipText(resourceMap.getString("jrb_obcomienza.toolTipText")); // NOI18N
        jrb_obcomienza.setActionCommand(resourceMap.getString("jrb_obcomienza.actionCommand")); // NOI18N
        jrb_obcomienza.setName("jrb_obcomienza"); // NOI18N
        jrb_obcomienza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_obcomienzaActionPerformed(evt);
            }
        });

        buttonGroup2.add(jrb_obaniway);
        jrb_obaniway.setText(resourceMap.getString("jrb_obaniway.text")); // NOI18N
        jrb_obaniway.setToolTipText(resourceMap.getString("jrb_obaniway.toolTipText")); // NOI18N
        jrb_obaniway.setActionCommand(resourceMap.getString("jrb_obaniway.actionCommand")); // NOI18N
        jrb_obaniway.setName("jrb_obaniway"); // NOI18N
        jrb_obaniway.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_obaniwayActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bidfam);
        jrb_bidfam.setText(resourceMap.getString("jrb_bidfam.text")); // NOI18N
        jrb_bidfam.setToolTipText(resourceMap.getString("jrb_bidfam.toolTipText")); // NOI18N
        jrb_bidfam.setActionCommand(resourceMap.getString("jrb_bidfam.actionCommand")); // NOI18N
        jrb_bidfam.setName("jrb_bidfam"); // NOI18N
        jrb_bidfam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bidfamActionPerformed(evt);
            }
        });

        jcbx_tipoinsumo.setName("jcbx_tipoinsumo"); // NOI18N
        jcbx_tipoinsumo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbx_tipoinsumoActionPerformed(evt);
            }
        });

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        buttonGroup1.add(jrbtn_tipoinsumo);
        jrbtn_tipoinsumo.setText(resourceMap.getString("jrbtn_tipoinsumo.text")); // NOI18N
        jrbtn_tipoinsumo.setActionCommand(resourceMap.getString("jrbtn_tipoinsumo.actionCommand")); // NOI18N
        jrbtn_tipoinsumo.setName("jrbtn_tipoinsumo"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jcmbx_almacenes.setName("jcmbx_almacenes"); // NOI18N

        buttonGroup1.add(jRadioButton1);
        jRadioButton1.setText(resourceMap.getString("jRadioButton1.text")); // NOI18N
        jRadioButton1.setToolTipText(resourceMap.getString("jRadioButton1.toolTipText")); // NOI18N
        jRadioButton1.setActionCommand(resourceMap.getString("jRadioButton1.actionCommand")); // NOI18N
        jRadioButton1.setName("jRadioButton1"); // NOI18N
        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton1ActionPerformed(evt);
            }
        });

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jRadioButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrb_bclave)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bdescrip)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bitem)
                        .addGap(4, 4, 4)
                        .addComponent(jrb_bprecio)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_bidfam)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtn_tipoinsumo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jcmbx_almacenes, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jrb_obexacto)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrb_obcomienza)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrb_obaniway)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jbtn_buscar)
                        .addGap(19, 19, 19)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jcbx_tipoinsumo, 0, 159, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrb_obcomienza)
                    .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jrb_obaniway)
                    .addComponent(jrb_obexacto)
                    .addComponent(jLabel3)
                    .addComponent(jcbx_tipoinsumo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_buscar)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrb_bclave)
                    .addComponent(jrb_bdescrip)
                    .addComponent(jrb_bprecio)
                    .addComponent(jrb_bitem)
                    .addComponent(jrb_bidfam)
                    .addComponent(jrbtn_tipoinsumo)
                    .addComponent(jcmbx_almacenes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jRadioButton1)
                    .addComponent(jLabel7)))
        );

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N
        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setName("jPanel2"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jt_insumos_catalogo.setModel(this.jtable_modelo);
        jt_insumos_catalogo.setName("jt_insumos_catalogo"); // NOI18N
        jt_insumos_catalogo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_insumos_catalogoMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane1.setViewportView(jt_insumos_catalogo);

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jlbl_textobuscado.setFont(resourceMap.getFont("jlbl_textobuscado.font")); // NOI18N
        jlbl_textobuscado.setText(resourceMap.getString("jlbl_textobuscado.text")); // NOI18N
        jlbl_textobuscado.setName("jlbl_textobuscado"); // NOI18N

        jLabel5.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jlbl_cantidadregistros.setFont(resourceMap.getFont("jlbl_cantidadregistros.font")); // NOI18N
        jlbl_cantidadregistros.setText(resourceMap.getString("jlbl_cantidadregistros.text")); // NOI18N
        jlbl_cantidadregistros.setName("jlbl_cantidadregistros"); // NOI18N

        jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jlbl_textobuscado, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(110, 110, 110)
                        .addComponent(jLabel5)
                        .addGap(18, 18, 18)
                        .addComponent(jlbl_cantidadregistros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel6))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jlbl_cantidadregistros)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4)
                    .addComponent(jlbl_textobuscado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        jPanel4.setName("jPanel4"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jt_insumos_catalogostock.setModel(this.jtable_modelo_insumosstock);
        jt_insumos_catalogostock.setName("jt_insumos_catalogostock"); // NOI18N
        jScrollPane2.setViewportView(jt_insumos_catalogostock);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 838, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addGap(7, 7, 7)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 824, Short.MAX_VALUE)
                    .addGap(7, 7, 7)))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 410, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE)
                    .addGap(19, 19, 19)))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

        jPanel5.setName("jPanel5"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jepn_fotos.setContentType(resourceMap.getString("jepn_fotos.contentType")); // NOI18N
        jepn_fotos.setName("jepn_fotos"); // NOI18N
        jScrollPane3.setViewportView(jepn_fotos);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 838, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 828, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 410, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem1);

        jMenuBar1.add(jMenu2);

        jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
        jMenu3.setName("jMenu3"); // NOI18N
        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 843, Short.MAX_VALUE)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 438, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(48, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
       if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
        {
            this.dispose();
        }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jrb_bclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bclaveActionPerformed
        // TODO add your handling code here:

        buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_bclaveActionPerformed

    private void jrb_bdescripActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bdescripActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_bdescripActionPerformed

    private void jtf_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_busquedaActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
}//GEN-LAST:event_jtf_busquedaActionPerformed

    private void jbtn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_buscarActionPerformed
        // TODO add your handling code here:
        // this.jtf_busqueda.getText();
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
             String arreglo_almainsu[]=this.jcmbx_almacenes.getSelectedItem().toString().split(":");
            this.carga_datos_catalogo(buscamp,opbuscamp,this.jtf_busqueda.getText(),Integer.valueOf(arreglo_almainsu[0]));
        } else {
            this.jtf_busqueda.requestFocus();
        }
    }//GEN-LAST:event_jbtn_buscarActionPerformed

    private void jrb_bitemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bitemActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_bitemActionPerformed

    private void jrb_bprecioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bprecioActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_bprecioActionPerformed

    private void jrb_obexactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obexactoActionPerformed
        // TODO add your handling code here:
        opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_obexactoActionPerformed

    private void jrb_obcomienzaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obcomienzaActionPerformed
        // TODO add your handling code here:
        opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_obcomienzaActionPerformed

    private void jrb_obaniwayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obaniwayActionPerformed
        // TODO add your handling code here:
        opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_obaniwayActionPerformed

    private void jrb_bidfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bidfamActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bidfamActionPerformed

    private void jcbx_tipoinsumoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tipoinsumoActionPerformed
        // TODO add your handling code here:
        if (controlcomboinsu > 0 ) {
            String arreglo_tipoinsu[]=this.jcbx_tipoinsumo.getSelectedItem().toString().split(":");
            this.buttonGroup1.setSelected(jrbtn_tipoinsumo.getModel(), true);
            buscamp=6;
            this.jtf_busqueda.setText(arreglo_tipoinsu[0]);
            this.jbtn_buscarActionPerformed(evt);
            //this.cambiartamanofilas();
        }
}//GEN-LAST:event_jcbx_tipoinsumoActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        // TODO add your handling code here:
     buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jRadioButton1ActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
         indexactual=this.jTabbedPane1.getSelectedIndex();
           if((indexactual==1)&&(yacarguestock==0))
                {
                    yacarguestock=1;
                    this.carga_datos_catalogo_stock(8,1, "", 0);
                }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jbtn_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_salirActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jbtn_salirActionPerformed
private void loadcombotipoinsu(){
          rs = x.sieuno_executediversosv2("select * from x1distribucion_insumos_tipos() as (id smallint, descrip character varying(40));",variables_global.getconexiongral());
            try
            {
               while (rs.next())
                    {
                      this.jcbx_tipoinsumo.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

private void loadcomalmacenes(){

          this.jcmbx_almacenes.addItem(variables_global.getalmacen()+":"+variables_global.getalmacen());
          rs = x.sieuno_executediversosv2("select * from x1distribucion_insumos_almacenes() as (id smallint,cla character varying(30));",variables_global.getconexiongral());
            try
            {

               while (rs.next())
                    {
                      this.jcmbx_almacenes.addItem(rs.getString("id")+":"+rs.getString("cla"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }



    }

private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jt_insumos_catalogo.getSelectedRow();
         String valor = jt_insumos_catalogo.getValueAt(fila, 2).toString();

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        insumos_articulos_edita fiae=new insumos_articulos_edita(valor);
        fiae.pack();
        fiae.setVisible(true);
        //setVisible(false);
    }
private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
 private void jt_insumos_catalogoMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new insumos_articulos_catalogo().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_buscar;
    private javax.swing.JButton jbtn_salir;
    private javax.swing.JComboBox jcbx_tipoinsumo;
    private javax.swing.JComboBox jcmbx_almacenes;
    private javax.swing.JEditorPane jepn_fotos;
    private javax.swing.JLabel jlbl_cantidadregistros;
    private javax.swing.JLabel jlbl_textobuscado;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrb_bclave;
    private javax.swing.JRadioButton jrb_bdescrip;
    private javax.swing.JRadioButton jrb_bidfam;
    private javax.swing.JRadioButton jrb_bitem;
    private javax.swing.JRadioButton jrb_bprecio;
    private javax.swing.JRadioButton jrb_obaniway;
    private javax.swing.JRadioButton jrb_obcomienza;
    private javax.swing.JRadioButton jrb_obexacto;
    private javax.swing.JRadioButton jrbtn_tipoinsumo;
    private javax.swing.JTable jt_insumos_catalogo;
    private javax.swing.JTable jt_insumos_catalogostock;
    private javax.swing.JTextField jtf_busqueda;
    // End of variables declaration//GEN-END:variables

}
